﻿@model EmailModel
@{
    ViewBag.Title = "Email Registered Users";
    var module = ViewBag.Module as Module;
}
<p>Sent an email to all registered users of <strong>@module.Title</strong> on @module.Start.ToShortDateString().</p>
@using (Html.BeginForm())
{
    @Html.ValidationSummary(true, "Please fill out all the required fields for sending an email.")
    <fieldset>
        <legend>Email Details</legend>
        <div class="editor-label">
            <label>To</label>
        </div>
        <div class="editor-field">
            @Html.TextBox("to", module.Title + " registered users", new { disabled = "disabled", @class = "wide" })
        </div>
        <div class="editor-label">
            <label>From</label>
        </div>
        <div class="editor-field">
            @Html.TextBox("from", ContextManager.CurrentUser.EmailAddress, new { disabled = "disabled" }) <span class="note">Not the right email address? @Html.ActionLink("Edit your contact information", "EditProfile", "Account")</span>
        </div>
        <div class="editor-label">
            @Html.LabelForWithReq(m => m.Subject)
        </div>
        <div class="editor-field">
            @Html.TextBoxFor(m => m.Subject)
            @Html.ValidationMessageFor(m => m.Subject)
        </div>
        <div class="editor-label">
            @Html.LabelForWithReq(m => m.Body)
        </div>
        <div class="editor-field">
            @Html.TextAreaFor(m => m.Body, new { @class = "adminBasicText" })
        </div>
        <p class="buttons">
            <input type="submit" value="Send" />
        </p>
    </fieldset>
}